Package-level declarations
Package that contains the DidDht
class, which is used to create and resolve dids using the dht
method.
Examples
Creation
Creating a DID DHT
package example
import web5.sdk.crypto.InMemoryKeyManager
import web5.sdk.dids.methods.dht.DidDht
import web5.sdk.dids.methods.dht.CreateDidDhtOptions
import foundation.identity.did.Service
val keyManager = InMemoryKeyManager()
// Add a service to the DID Document
val service = Service.Builder()
.id(URI("test-service"))
.type("HubService")
.serviceEndpoint("https://example.com/service)")
.build()
val opts = CreateDidDhtOptions(
services = listOf(service),
// Automatically publishes to the DHT
publish = true
)
val did = DidDht.create(keyManager, opts)
Content copied to clipboard
Resolution
Resolve a DID DHT
val did = DidDht.resolve("did:dht:gb46emk73wkenrut43ii67a3o5qctojcaucebth7r83pst6yeh8o")
Content copied to clipboard
Types
Link copied to clipboard
class CreateDidDhtOptions(val verificationMethods: Iterable<<Error class: unknown class><Jwk, List<Purpose>, String?>>? = null, val services: Iterable<Service>? = null, val publish: Boolean = true, val controllers: Iterable<String>? = null, val alsoKnownAses: Iterable<String>? = null) : CreateDidOptions
Specifies options for creating a new "did:dht" Decentralized Identifier (DID).
Link copied to clipboard
Provides a specific implementation for creating and resolving "did:dht" method Decentralized Identifiers (DIDs).
Link copied to clipboard
Base class for managing DID DHT operations. Uses the given DidDhtConfiguration.
Link copied to clipboard
class DidDhtConfiguration
Configuration for the DidDhtApi.
Link copied to clipboard
Did document metadata for did:dht that extends the base did document metadata.
Link copied to clipboard
Type indexing types as per https://tbd54566975.github.io/did-dht-method/#type-indexing
Functions
Link copied to clipboard
Returns a DidDhtApi after applying configurationBlock on the default DidDhtConfiguration.